export interface ResponseData {
    code:number,
    message:string,
    ok:boolean
}

export interface SpuData {
    id?:number,
    spuName:string,
    description:string,
    category3Id:string|number,
    tmId:number|string,
    spuSaleAttrList:null|Array<SaleAttr>,
    spuImageList:null|Array<SpuImg>
}

export type Records = Array<SpuData>

export interface HasSpuResponseData extends ResponseData {
    data:{
        records:Records,
        total:number,
        size:number,
        current:number,
        pages:number,
        searchCount:boolean
    }
}

//所有品牌数据
export interface Trademark {
    id:number,
    tmName:string,
    logoUrl:string
}

export interface AllTrademark extends ResponseData {
    data:Array<Trademark>
}

export interface SpuImg {
    id?:number,
    createTime?:string,
    updateTime?:string,
    spuId?:number,
    imgName?:string,
    imgUrl?:string,
    name?:string,
    url?:string
}

export interface SpuHasImg extends ResponseData {
    data:Array<SpuImg>
}

export interface SaleAttrValue {
    id?:number,
    createTime?:null,
    updateTime?:string,
    spuId?:number,
    baseSaleAttrId:number|string,
    saleAttrValueName:string,
    saleAttrName?:string,
    isChecked?:null
}

export type SpuSaleAttrValueList = Array<SaleAttrValue>

export interface SaleAttr {
    id?:number,
    createTime?:null,
    updateTime?:string,
    spuId?:number,
    baseSaleAttrId:number|string,
    saleAttrName:string,
    spuSaleAttrValueList:SpuSaleAttrValueList,
    flag?:Boolean,
    saleAttrValue?:string
}

export interface SaleAttrResponseData extends ResponseData {
    data:Array<SaleAttr>
}

//已有全部spu的返回数据类型
export interface HasSaleAttr {
    id:number,
    name:string,
    createTime:string,
    updateTime:string
}

export interface HasSaleAttrResponseData extends ResponseData {
    data:Array<HasSaleAttr>
}


export interface Attr {
    attrId:number|string,
    valueId:number|string
}

export interface saleAttr {
    saleAttrId:number|string,
    saleAttrValueId:string|number
}
export interface SkuData {
    category3Id:string|number,
    spuId:string|number,
    tmId:string|number,
    skuName:string|number,
    price:string|number,
    weight:string|number,
    skuDesc:string,
    skuAttrValueList?:Array<Attr>,
    skuSaleAttrValueList?:Array<saleAttr>,
    skuDefaultImg:string
}

export interface SkuInfoData extends ResponseData {
    data:Array<SkuData>
}